/**
 * 
 */
package tesys.objects;

/**
 * @author Group5 Comp3350
 * This class defines a User object
 * 
 */
public class User{

	private String name;
	private String id;
	//constructor
	public User(String name, String ID)
	{
		this.name=name;
		this.id=ID;
	}
	public User(String ID)
	{
		this.name=null;
		this.id=ID;
	}	
	//accessor
	public String getName(){return name;}
	public String getID(){return id;}
	
	//compareTo()
	//to check if 2 objects are same
	public boolean compareTo(Object obj)
	{
		boolean result;
		User t;
		
		result = false;
		
		if (obj instanceof User)
		{
			t = (User) obj;
			if (t.getID().equalsIgnoreCase(id))
			{
				result = true;
			}
		}
		return result;
	}

	//toString()
	public String toString () 
	{
		return "User ID: "+id+" User Name: "+name;
	}

}


